package com.lxg;

import com.server.FeigServer;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.RequestContextHolder;

import javax.annotation.Resource;

@RestController
@RequestMapping("/user")
public class FeignController {

    @Resource
    private FeigServer feig;

    @RequestMapping("/s/{name}")
    public String s(@PathVariable String name) {
        RequestContextHolder.setRequestAttributes(RequestContextHolder.getRequestAttributes(), true);
        String s = feig.s();
        System.out.println("开始PRC");
        return "返回参数来自RPC: " + s;
    }

}
